package com.cuitrip.business.user;


import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.cuitrip.business.bill.model.UserAccount;
import com.cuitrip.business.bill.model.UserAccounts;
import com.cuitrip.service.R;
import com.cuitrip.util.ResourceUtil;
import com.lab.app.customui.CustomUiConfig;
import com.lab.app.customui.CustomUiFragment;
import com.lab.jumper.FragmentJumper;
import com.lab.jumper.JumperManager;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by sheena on 16/5/16.
 */
public class VerifyMobileSuccessFragment extends CustomUiFragment {

    @Bind(R.id.v1)
    View mStep1;

    @Bind(R.id.v2)
    View mStep2;

    @Bind(R.id.v3)
    View mStep3;

    @Bind(R.id.tv_mobile_number)
    TextView mMobileNum;

    private static final String PHOTO_NUMBER="photo_number";
    private String photoNumber;

    public static VerifyMobileSuccessFragment newInstance(String photoNumber) {
        VerifyMobileSuccessFragment verifyMobileSuccessFragment = new VerifyMobileSuccessFragment();
        Bundle bundle = new Bundle();
        bundle.putString(PHOTO_NUMBER, photoNumber);
        verifyMobileSuccessFragment.setArguments(bundle);
        return verifyMobileSuccessFragment;
    }


    @Override
    public boolean initCloseTopBar() {
        return false;
    }

    @Override
    public CustomUiConfig initCustomUiConfig() {
        CustomUiConfig config = new CustomUiConfig();
        config.mLeftStyle= CustomUiConfig.AreaStyle.ICON_STYLE;
        config.mTopbarLeftAreaName=getString(R.string.back_icon);
        config.mTopbarMiddleAreaName=getString(R.string.trip_operation_profile_title_2);
        return config;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState, R.layout.fragment_verified_phone_suc);
        if (getArguments()!=null){
            photoNumber = getArguments().getString(PHOTO_NUMBER);
        }
        return view;
    }

    @Override
    public void initView() {
        ButterKnife.bind(this,getView());
        mStep1.setBackgroundColor(ResourceUtil.getThemeColor());
        mStep2.setBackgroundColor(ResourceUtil.getThemeColor());
        mStep3.setBackgroundColor(ResourceUtil.getColor(R.color.ganshi_ded8d7));
    }

    @Override
    public void initData() {
        if (!TextUtils.isEmpty(photoNumber)){
            mMobileNum.setText(photoNumber);
        }
    }

    @OnClick(R.id.tv_btn_next)
    public void nextStep(){
        FragmentJumper.addFragment(getHostActivity().getCustomSelfFragmentManager(),R.id.container,new VerifyIDFragment(),VerifyIDFragment.class.getName(),true);

    }

}
